<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>测试vue生命周期函数</title>
	</head>
	<body>
		<div id="app">
			<h3 v-text="msg"></h3>
			<button @click="destroy"></button>
		</div>
		<script src="../js/vue.js"></script>
		<script>
			const app = new Vue({
						el: "#app",
						data: {
							msg: "vue生命周期"
						},
						beforeCreate() {
							console.log(beforeCreate)
						},
						created() {
							console.log(created)
						},
						beforeMount() {
							console.log(beforeMount)
						},
						mounted() {
							console.log(mounted)
						},
						beforeUpdate() {
							console.log(beforeUpdate)
						},
						updated() {
							console.log("updated")
						},
						beforeDestroy() {
							console.log("beforeDestroy")
						},
						destroyed() {
							console.log("destroyed")
						},
						methods: {
							destroy() {
								this.$destroy()
							}
						})
		</script>
	</body>
</html>
